package com.example.springboot.config.server;

import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer;
import org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer;

import java.util.concurrent.TimeUnit;

/**
 * @desc:通过代码设置服务启动端口、访问路径、session超时时间
 * @Author wangsh
 * @date 2018/6/14 21:20
 */
//@Configuration
public class ServerConfig implements EmbeddedServletContainerCustomizer {

	@Override
	public void customize(ConfigurableEmbeddedServletContainer container) {

		container.setPort(8090);
		container.setContextPath("/");
		container.setSessionTimeout(60, TimeUnit.MINUTES);
	}
}
